import request from '@/utils/request'

// 生成订单
export const saveOrderInvoice = (data: any) => {
  return request({
    url: '/order-invoice/saveOrderInvoice',
    type: 'post',
    data,
    qs: true
  })
}
// 发票列表
export const invoiceList = (data: any) => {
  return request({
    url: '/order-invoice/list',
    type: 'get',
    data
  })
}

// 开票信息列表
export const invoiceInfoList = (data: any) => {
  return request({
    url: '/user-tax/list',
    type: 'get',
    data
  })
}
// 开票信息详情
export const invoiceInfoDetail = (data: any) => {
  return request({
    url: '/user-tax/details',
    type: 'get',
    data
  })
}

// 新增开票信息或修改
export const invoiceInfoAddOrUpd = (data: any) => {
  return request({
    url: '/user-tax/addOrUpd',
    type: 'post',
    data,
    qs: true
  })
}

// 删除开票信息
export const invoiceInfoDel = (data: any) => {
  return request({
    url: '/user-tax/del',
    type: 'post',
    data
  })
}

// 获取默认发票抬头
export const invoiceInfoDefault = (data: any) => {
  return request({
    url: '/user-tax/getDefault',
    type: 'get',
    data
  })
}

// 设置默认发票新
export const invoiceInfoSetDefault = (data: any) => {
  return request({
    url: '/user-tax/setDefault',
    type: 'post',
    data
  })
}
